#define _CRT_SECURE_NO_WARNINGS 1
#include"AVLTree.h"

void test1()
{
	//int a[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
	int a[] = { 4,2,6,1,3,5,15,7,16,14 };
	AVLTree<int, int> avl;
	for (auto e : a)
	{
		if (e == 14)
		{
			int x = 0;
		}
		avl.Insert(make_pair(e, e));
		cout << e << "->" << avl.IsBalance() << endl;
	}
}

void test2()
{
	const int N = 100000;
	vector<int> v;
	AVLTree<int, int> avl;
	v.reserve(N);
	srand(time(0));

	for (int i = 0; i < N; i++)
	{
		v.push_back(rand());
	}

	for (auto e : v)
	{
		avl.Insert(make_pair(e, e));
	}
	cout << avl.IsBalance() << endl;
}
int main()
{
	test1();
	test2();

	return 0;
}